home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 128 10
/
q10.d81
/
t.control80 demo
< prev
next >
Wrap
Text File
|
2022-08-28
|
14KB
|
313 lines
C O N T R O L 8 0
By Jon Mattson
One of the greatest advantages of upgrading from a C-64 to a C-128 has
got to be the 80-column RGB capability. The improved resolution of the 8563
chip puts the 128 on par with its much more expensive rivals from a graphics
point of view. Text displays, such as those used in word processors,
benefit tremendously from the extra screen capacity, allowing the 128 to be
used as a serious work machine. For the not-so-serious, adventure games and
the like can also take advantage of this extra space. Then, too, there are
all sorts of nifty graphic tricks that can be produced with the 8563.
Unfortunately, 'tricks' might well be the operative word in that last
paragraph. If you have tried programming the 8563 at all, you probably
discovered early on that it was no task to be taken lightly. Using it at
all can be quite a sleight of hand trick, in itself. Since the chip has
only a two byte 'window' into the 128's normal memory, even apparently
simple tasks can be daunting. Machine language knowledge is a virtual
necessity for speedy graphics, since BASIC 7.0 virtually ignores the chip's
existence. Even the tried and true POKE and PEEK don't work! Thus, if you
aren't an ML wizard with a Programmer's Reference Guide, you probably had to
content yourself with PRINT and the occasional SYS to ROM tricks.
That was until now. CONTROL 80 changes all of that by adding 18 new
keywords to BASIC 7.0: 16 commands and 2 functions that give you full and
easy access to the 8563.
Using C80 is simple. Just BLOAD it into memory and SYS 4864, either in
direct mode or early on in your program. If you are in direct mode, a
message will inform you that it is installed. This message will not appear
from within a program, however, since it might ruin your screen
presentation. Generally, a simple BLOAD will suffice, but if you have been
playing around with BANKs and the like, you might want to use the full
syntax: BLOAD "CONTROL80",B0,P4864.
Once C80 is installed, the new keywords can be used just like any other
BASIC commands. You can even abbreviate them by shifting the second letter,
as usual. Remember that C80 must be active (not just resident) while you
type in a program using its keywords, or they will not be tokenized
correctly. Note also that C80 uses memory from 4864 to 6629 (only), so
avoid POKEing around this area.
Hitting the beloved STOP/RESTORE combination will not deactivate C80.
The QUIT command (previously unimplemented on the 128) will turn it off,
although SYS 4864 will bring it back to life. Resetting the computer will
also turn it off; however, due to its location, C80 will still be resident
for later use as long as you haven't POKEd over its memory space.
Now let's take a look at your new resources. Certain conventions have
been followed in this listing. Memory addresses are 0-65535, as usual, to
allow use with both 16K and 64K VDCs. Note, however, that addresses above
16383 wrap around on the 16K chip (i.e. 16384 = 0). Remember that the
basic 8563 chip is set up as follows:
$0000 - 07FF 0 - 2047 Screen
$0800 - 0FFF 2048 - 4095 Attribute
$1000 - 1FFF 4096 - 8191 Unused
$2000 - 2FFF 8192 - 12287 Upper Case/Graphic Char Set
$3000 - 3FFF 12288 - 16383 Lower/Upper Case Char Set
VDC register numbers (reg# below) range from 0-36. While it is not
within the scope of this article to explain the use of every register, a
simplified table listing each one will be given in the Appendix. A more
complete description can be found in the C-128 Programmer's Reference Guide
and many other sources. When in doubt, experiment with WVD - just be sure
that you check the registers normal value with RVD first to set things back
to normal!
*** FUNCTIONS ***
PEER (VDC address)
This function allows you to check the contents of VDC memory. It
operates just like BASIC's PEEK. For example, to find the character in the
top left corner of the screen: PRINT PEER(0). Note that PEER is the
counterpart of POST, below.
RVD (reg#)
This function (Read ViDeo register) allows you to check the contents of
any of the 37 VDC registers. For example, A=RVD(12) would put the contents
of register 12 in A. Note that RVD is the counterpart of WVD, below.
*** COMMANDS ***
BLOCK VDC address, number, value
This command is similar to FILL, below, except that it allows you to
fill ANY small section of VDC memory with a single value. "Address"
indicates the starting position of the fill, and "number" (2-255) indicates
how many locations to fill with the specified "value" (0-255) from that
point on. One of the best uses of BLOCK is to highlight a line on the
screen by filling attribute memory with a different color value and/or
reverse. For example, BLOCK 2048,80,72 would highlight the entire first
line of the screen by coloring it red and using reverse characters.
DUMP type
This command dumps the entire 80 column screen display to any Commodore
compatible printer. Remember that the 8563 allows two character sets on the
screen at the same time, but your printer will not: it will print the entire
screen with the character set specified. "Type" may be either 0 for an
upper case/graphics dump or 7 for a lower/upper case dump. These correspond
to the normal and alternate character sets, respectively, in VDC terms. If
you must access DUMP in direct mode, remember that you can use ESCAPE-X to
move to the 40-column screen and type the command there.
FCOPY address, bank, character set
This command allows you to convert and copy a standard 40-column font
already in normal memory at the "address" and "bank" specified to the 8563
chip. Since the 8563 allows two character sets simultaneously, you must
specify which one to replace: 0 for upper case/graphics or 1 for lower/upper
case. For example, if you wanted to replace the uc/g set with your font,
you might enter the following:
BLOAD "font",B0,P14336:FCOPY 14336,0,0
Note that you cannot simply VLOAD the font into 8563 memory, as the two
formats are different and require conversion. Once the font has been
FCOPYed into the VDC, you could VSAVE that, but it is actually less
efficient this way, taking up twice as much disk space and, thus, twice as
much loading time. Stick with FCOPY if at all possible.
FILL screen type, value
This command allows you to fill either screen ("type" 0) or attribute
("type" 1) memory with a single "value" from 0-255. Screen codes are as per
usual. Attribute codes include color, reverse, flash and the like:
Bit 7 (128) Alternate Character Set
6 (64) Reverse Video
5 (32) Underline
4 (16) Flash
3 (8) Red
2 (4) Green
1 (2) Blue
0 (1) Intensity
For example, FILL 1,154 will cause all characters to turn purple, flash
and use the alternate character set.
FINIT
This command simply reinitializes the 8563's normal fonts. It is
useful for cancelling the effects of FCOPY or undesirable POSTs into
character memory.
HOME
Homes the cursor within the current window.
LCLEAR first line, last line
This command clears the indicated lines (0-24), including any unusual
attribute effects such as flash and the like. Naturally, the last line must
ba hiahea than or equal to the value of the first. Note that linesaare only
cleared within the boundaries of theacurrent window, and the line values
will be offset by the position of the window from the real top of the
screen. Thus, the 0-24 range assumes a full-screen window and will be
smaller for smaller windows.
POST VDC address, value
This command allows you to place values into 8563 memory. It operates
just like BASIC's POKE. For example, POST 0,1 will place an "A" in the top
left corner of the screen. Note that POST is the counterpart of PEER.
RECALL bytes, VDC address, from RAM address, from bank
Thi